using System;
using System.Collections.Generic;

namespace Book.Blog.Core.Entities
{
    public class Post : BaseEntity
    {
        public string Title { get; set; } = string.Empty;
        public string Content { get; set; } = string.Empty;
        public string Summary { get; set; } = string.Empty;
        public string Slug { get; set; } = string.Empty;
        public string? CoverImage { get; set; }
        public bool IsDraft { get; set; }
        public bool IsPublished { get; set; }
        public DateTime? PublishTime { get; set; }
        public int ViewCount { get; set; }
        public int LikeCount { get; set; }
        public int CommentCount { get; set; }
        
        public Guid AuthorId { get; set; }
        public virtual User Author { get; set; } = null!;
        public Guid CategoryId { get; set; }
        public virtual Category Category { get; set; } = null!;
        public virtual ICollection<Tag> Tags { get; set; }
        public virtual ICollection<Comment> Comments { get; set; }
        public virtual ICollection<PostHistory> History { get; set; }

        public Post()
        {
            Tags = new HashSet<Tag>();
            Comments = new HashSet<Comment>();
            History = new HashSet<PostHistory>();
            IsDraft = true;
            IsPublished = false;
            ViewCount = 0;
            LikeCount = 0;
            CommentCount = 0;
        }
    }
} 